package com.itany.cms.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("t_course")
public class Course {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String courseName;
    private String courseInfo;
    private String author;
    private String coverImageUrl;
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createDate;
    @TableField(exist = false)
    private LocalDateTime startDate;
    @TableField(exist = false)
    private LocalDateTime endDate;
    private Integer clickNumber;
    private Integer status;
    private Integer recommendationGrade;
    private Integer courseTypeId;
    @TableField(exist = false)
    private String courseTypeName;
    @TableField(exist = false)
    private CourseType type;

    public Course(String courseName, String courseInfo, String author, String coverImageUrl, LocalDateTime createDate, LocalDateTime startDate, LocalDateTime endDate, Integer clickNumber, Integer status, Integer recommendationGrade, Integer courseTypeId, CourseType type) {
        this.courseName = courseName;
        this.courseInfo = courseInfo;
        this.author = author;
        this.coverImageUrl = coverImageUrl;
        this.createDate = createDate;
        this.startDate = startDate;
        this.endDate = endDate;
        this.clickNumber = clickNumber;
        this.status = status;
        this.recommendationGrade = recommendationGrade;
        this.courseTypeId = courseTypeId;
        this.type = type;
    }

    private

     Course(String courseName, String courseInfo, String author, String coverImageUrl, LocalDateTime createDate, LocalDateTime startDate, LocalDateTime endDate, Integer clickNumber, Integer status, Integer recommendationGrade, Integer courseTypeId) {
        this.courseName = courseName;
        this.courseInfo = courseInfo;
        this.author = author;
        this.coverImageUrl = coverImageUrl;
        this.createDate = createDate;
        this.startDate = startDate;
        this.endDate = endDate;
        this.clickNumber = clickNumber;
        this.status = status;
        this.recommendationGrade = recommendationGrade;
        this.courseTypeId = courseTypeId;
    }
}
